{% extends "manage/manage_base.html" %}

{% load i18n %}
{% load lfs_tags %}

{% block section %}add-product{% endblock %}
{% block help_link %}user/management/catalog/products.html{% endblock %}
{% block left-slot-wrapper %}{% endblock %}

{% block content %}
    <div id="product">
        <div id="manage-tabs">
            <ul>
                <li class="ui-tabs-nav-item"><a href="#data">{% trans 'Add product' %}</a></li>
            </ul>
            <div id="data">
                <h2>{% trans "Data" %}</h2>
                <form id="product-data-form"
                      action="{% url lfs_manage_add_product %}"
                      method="post">
                    {% csrf_token %}
                    {% include "manage/lfs_form.html" %}

                    <div class="buttons">
                        <input class="button"
                               type="submit"
                               id="product-add-button"
                               value='{% trans "Add product" %}' />

                        <input type="button"
                               class="button"
                               onclick="window.location='{{ came_from }}'"
                               value="{% trans 'Cancel' %}" />
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script>
        $(function() {
            $("#id_name").live("keyup", function() {
                var slug = $("#id_name").val()
                slug = URLify(slug, 200)
                $("#id_slug").val(slug);
            });
        });
    </script>
{% endblock %}
